package com.mjw.zstu.Exception;

import com.mjw.zstu.resultDto.JsonResult;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.RestControllerAdvice;

import javax.servlet.http.HttpServletRequest;
import java.net.BindException;

@RestControllerAdvice
public class GlobalException {
    @ExceptionHandler(BindException.class)
    public JsonResult handlerBindException(BindException bindException){
        StringBuilder errorMsg=new StringBuilder();
        return new JsonResult(500,"错误","null");
    }
}
